/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date           Author       Notes
* 2019-03-05     whj4674672   first version
*/

#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
#include <drv_common.h>

#define LEDR_PIN    GET_PIN(B, 0)
#define LEDG_PIN    GET_PIN(B, 1)
#define LEDB_PIN    GET_PIN(A, 3)

int main(void)
{
    rt_uint32_t count = 1;

    rt_pin_mode(LEDR_PIN, PIN_MODE_OUTPUT);
    rt_pin_mode(LEDG_PIN, PIN_MODE_OUTPUT);
    rt_pin_mode(LEDB_PIN, PIN_MODE_OUTPUT);

    while(count++)
    {
        rt_pin_write(LEDR_PIN, PIN_LOW);
        rt_pin_write(LEDG_PIN, PIN_LOW);
        rt_pin_write(LEDB_PIN, PIN_LOW);
        rt_thread_mdelay(500);
        rt_pin_write(LEDR_PIN, PIN_HIGH);
        rt_pin_write(LEDG_PIN, PIN_HIGH);
        rt_pin_write(LEDB_PIN, PIN_HIGH);
        rt_thread_mdelay(500);
    }
    return RT_EOK;
}

//#include "stm32h7xx.h"
//static int vtor_config(void)
//{
//    /* Vector Table Relocation in Internal QSPI_FLASH */
//    SCB->VTOR = QSPI_BASE;
//    return 0;
//}
//INIT_BOARD_EXPORT(vtor_config);
